package com.mkx.core.factory;

import com.mkx.core.lock.BatchRedisLock;
import com.mkx.properties.RedisLockProperties;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * Redis分布式批量锁工厂类
 * 用于创建BatchRedisLock实例
 */
public class BatchRedisLockFactory {

    private final RedisTemplate<String, Object> redisTemplate;
    private final RedisLockProperties properties;
    
    /**
     * 构造函数
     */
    public BatchRedisLockFactory(RedisTemplate<String, Object> redisTemplate,
                               RedisLockProperties properties) {
        this.redisTemplate = redisTemplate;
        this.properties = properties;
    }
    
    /**
     * 创建批量锁实例
     */
    public BatchRedisLock createBatchLock(String... lockKeys) {
        return new BatchRedisLock(redisTemplate, properties, lockKeys);
    }
}